var express = require('express');
var router = express.Router();
//引入学生的业务层
const studentService = require("../src/services/studentService")

/* GET users listing. */
router.get('/showstudents', async function(req, resp) {
   //获得客户端传入的参数 当前页数和每页显示条数
    //注意： 凡是从客户端传出的值 都是字符串 (如果参数为number则需要转换类型)
    let {currentpage,pagesize} = req.query;

    console.log(currentpage,pagesize);

    let pageBean = await studentService.showStundetInfosByPage(
                                       {"currentPage":parseInt(currentpage),
                                        "pageSize":parseInt(pagesize)})
    resp.json({"code":0,"msg":"success",...pageBean});     
});

module.exports = router;
